{{! corresponding files: assets_edit.php & assets_edit.json }}
<header>
<div class="pure-u-1 pure-u-md-1-2">
	{{#parent_id}}
		<a class="returnlink current" href="{{www_path}}/assets/edit/{{parent_id}}"><div class="icon icon-arw-dwn"></div><!--icon--></a>
	{{/parent_id}}

	{{^parent_id}}
	<a class="returnlink current" href="{{www_path}}/assets/"><div class="icon icon-arw-dwn"></div><!--icon--></a>
	{{/parent_id}}
	<h4 class="secondary-title">&ldquo;{{title}}&rdquo;</h4>
</div><!--pure-->
<div class="pure-u-1 pure-u-md-1-2">
	<ul class="inline-subnav right">
		<li><a href="{{www_path}}/commerce/items/add/selectedasset/{{id}}" class="lightboxed returntocurrentroute"><span class="icon icon-circle-plus"></span>{{copy_add_to_inventory}}</a></li>
        {{#fulfillment_assets}}
        <li>
            <a target="_blank" href="{{public_url}}/request?cash_request_type=asset&cash_action=claim&id={{id}}&element_id={{element_id}}&session_id={{session_id}}" class="download"><span class="icon icon-circle-plus"></span>
                Download Asset
            </a>
        </li>
        {{/fulfillment_assets}}
	</ul>
</div><!--pure-->
</header>

<div class="pure-u-1">
<form accept-charset="UTF-8" method="post" id="edit-file-form" action="{{www_path}}/assets/edit/{{id}}">
	<input type="hidden" name="doassetedit" value="makeitso" />
	<input type="hidden" name="asset_type" value="file" />

	<label for="asset_title">{{label_title}}</label>
	<input type="text" id="asset_title" name="asset_title" value="{{title}}" class="required" />

	<label for="asset_description">{{label_description}}</label>
	<textarea rows="3" id="asset_description" name="asset_description">{{description}}</textarea>

		<div class="pure-u-1 pure-u-md-1-2">
			<label for="connection_id">{{label_connection}}</label>
			<select id="connection_id" name="connection_id">
				{{{connection_options}}}
			</select>
		</div><!--pure-->

		<div class="pure-u-1 pure-u-md-1-2">
			<label for="asset_location">{{^show_make_public}}<div class="icon icon-unlock"></div><!--icon-->{{/show_make_public}}{{#show_make_public}}<div class="icon icon-locked"></div><!--icon-->{{/show_make_public}} {{label_location}} {{#show_make_public}}
			<span class="file-security spacedtext">
					<a href="#" data-publicize-endpoint="{{{www_path}}}/ajax/publicizeasset/{{id}}" class="usecolor2 needsconfirmation"><strong>{{copy_make_public}}</strong></a>
			</span><!--file-security-->
			{{/show_make_public}}

            </label>

			<input class="required" type="text" id="asset_location" name="asset_location" value="{{location}}" />
		</div><!--pure-->

		{{#parent_id}}
		<input type="hidden" name="parent_id" value="{{parent_id}}" />
		{{/parent_id}}

		<div class="drawer noprefix upload-corral">
		{{#show_make_public}}<p class="file-upload-trigger">Sorry, you can't currently overwrite a private file</p>{{/show_make_public}}

				{{^show_make_public}}<a href="#" data-upload-endpoint="{{{www_path}}}/assets/uploadform/" class="drawerhandle usecolor2 file-upload-trigger"><span class="icon icon-cloud-upload"></span><!--icon--><span>{{copy_upload_a_file}}</span></a>{{/show_make_public}}

			<div class="drawercontent"></div>
		</div>
	</form>


	<div class="material drawer">
			<h5 class="drawerhandle hide title"><div class="icon icon-dwnld"></div><!--icon-->{{copy_export_create_download_codes}} <span class="notes">({{#asset_codes_count}}{{copy_there_are}}{{asset_codes_count}}{{copy_codes_for_this_asset}}<a class="usecolor2 noajax" href="{{www_path}}/assets/edit/{{id}}?exportcodes=1"><strong>{{copy_export_them}}</strong></a>{{/asset_codes_count}}
						{{^asset_codes_count}}
						{{copy_no_download_codes}}
						{{/asset_codes_count}})</span></h5>
					<div class="drawercontent pure-u-1 ">
						<form accept-charset="UTF-8" method="post" action="{{www_path}}/assets/edit/{{id}}"-->
								<div class="pure-u-1">
								<label for="add_codes_qty">{{label_add_more_codes}}</label>
								<div class="pure-u-1 pure-u-md-4-5 l-box"><input type="text" name="add_codes_qty" id="add_codes_qty" value="500" /></div><div class="pure-u-1 pure-u-md-1-5"><button class="alt-button fullwidth" data-cash-target-form="#add_codes_qty" type="submit">{{copy_add_codes}}</button></div>
							</div><!--pure-->
						</form>
					</div><!--drawercontent-->
		</div><!--material-->


	<div class="pure-u-1">
				<button class="nojs" type="submit">Save changes</button>
				<button class="onlyjs externalsubmit" data-cash-target-form="#edit-file-form" type="submit">{{copy_button_save_changes}}</button>
				<a href="{{www_path}}/assets/delete/{{id}}/{{connection_id}}" class="button usecolor2 needsconfirmation">{{copy_button_delete_file}}</a>
			</div><!--pure-->
</div><!--pure-->
